package com.yungu.swift.assets.driver.dao;

import com.yungu.swift.assets.driver.model.dto.DriverTrainDto;
import com.yungu.swift.base.mapper.IMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * DriverTrainMapper数据库操作接口类
 **/

public interface DriverTrainMapper extends IMapper<DriverTrainDto> {
    /**
     * 获取
     *
     * @param uuid String
     * @return DriverTrainDto
     */
    DriverTrainDto get(String uuid);

    /**
     * 批量添加
     *
     * @param driverTrainDtoList List<DriverTrainDto>
     * @return int
     */
    int addBatch(List<DriverTrainDto> driverTrainDtoList);

    /**
     * 批量导入
     *
     * @param driverTrainDtoList List<DriverTrainDto>
     * @return int
     */
    int importUpdateBatch(List<DriverTrainDto> driverTrainDtoList);

    /**
     * 删除 TODO:是否移入 xml文件中
     *
     * @param driverUuid String
     * @return int
     */
    @Delete("DELETE FROM t_driver_train WHERE driver_uuid=#{driverUuid}")
    int delByDriver(@Param("driverUuid") String driverUuid);
}